<!doctype html>
<html class="x-admin-sm">

	<head>
		<meta charset="UTF-8">
		<title>飞乐宝奶粉</title> <meta name="renderer" content="webkit|ie-comp|ie-stand"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<link rel="stylesheet" href="css/font.css">
		<link rel="stylesheet" href="css/xadmin.css">
		<script src="lib/layui/layui.js" charset="utf-8"></script>
		<script type="text/javascript" src="js/xadmin.js"></script>
	</head>

	<body class="index">
		<!-- 顶部开始 -->
		<div class="container">
			<div class="logo">
				<a href="./index.html">权限管理系统</a>
			</div>
			<div class="left_open">
				<a><i title="展开左侧栏" class="iconfont">&#xe699;</i></a>
			</div>
			<span style="width: 100px; height: 200px; color:white;float: right; margin-top: 10px;">  <a id="msg" ><i class=" layui-icon layui-icon-release"  id="tanchu"> 消息</i></a>  </span>
			<ul class="layui-nav right" lay-filter="">
				<li class="layui-nav-item">
					<a href="javascript:;"><span id="n"></span></a>
					<dl class="layui-nav-child">
						<!-- 二级菜单 -->
						<dd>
							<a href="UdatePassword.html">修改密码</a>
						</dd>
						<dd>
							<a href="javascript:;" class="login-out">退出登录</a>
						</dd>
					</dl>
				</li>
			</ul>
		</div>
		<!-- 顶部结束 -->
		<!-- 中部开始 -->
		<!-- 左侧菜单开始 -->
		<div class="left-nav">
			<div id="side-nav">
				<ul id="nav">
				</ul>
				<!--<li>
						<a href="javascript:;"> <i class="iconfont left-nav-li" lay-tips="阅览室">&#xe6b8;</i> <cite>管理</cite> <i class="iconfont nav_right">&#xe697;</i></a>
						<ul class="sub-menu">
							<li>
								<a onclick="xadmin.add_tab('用户','http://localhost:8080/statics/Usersinfo.html')"> <i class="iconfont">&#xe6a7;</i> <cite>用户</cite></a>
							</li>
							<!--Modulesinfo.html-->
				<!--<li>
								<a onclick="xadmin.add_tab('角色','http://localhost:8080/statics/Rolesinfo.html')"> <i class="iconfont">&#xe6a7;</i> <cite>角色</cite></a>
							</li>
							<li>
								<a onclick="xadmin.add_tab('角色','http://localhost:8080/statics/Modulesinfo.html')"> <i class="iconfont">&#xe6a7;</i> <cite>模块</cite></a>
							</li>
						</ul>
					</li>-->

			</div>
		</div>
		<!-- <div class="x-slide_left"></div> -->
		<!-- 左侧菜单结束 -->
		<!-- 右侧主体开始 -->
		<div class="page-content">
			<div class="layui-tab tab" lay-filter="xbs_tab" lay-allowclose="false">
				<ul class="layui-tab-title">
					<li class="home"><i class="layui-icon">&#xe68e;</i>我的桌面</li>
				</ul>
				<div class="layui-unselect layui-form-select layui-form-selected" id="tab_right">
					<dl>
						<dd data-type="this">关闭当前</dd>
						<dd data-type="other">关闭其它</dd>
						<dd data-type="all">关闭全部</dd>
					</dl>
				</div>
				<div class="layui-tab-content">
					<div class="layui-tab-item layui-show">
						<iframe src='./welcome.html' frameborder="0" scrolling="yes" class="x-iframe"></iframe>
					</div>
				</div>
				<div id="tab_show"></div>
			</div>
		</div>
		<div class="page-content-bg"></div>
		<style id="theme_style"></style>
		<!-- 右侧主体结束 -->
		<!-- 中部结束 -->
		<script src="js/User.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/jquery.min.js" charset="utf-8"></script>
		<script type="text/javascript">
			$("#n").html(globalData.getUid());
			//安全退出
			$(".login-out").click(function() {
				layer.confirm('你确定要退出吗?', {
					icon: 3,
					title: '退出系统'
				}, function(index) {
					globalData.loginOut();
					layer.close();
				}, function(index) {
					layer.close(index);
				});
			});
			///差东西

			//左侧菜单栏	
			//			$("#navs").html("");
			//			$.each(data1, function(n, value) {
			//				var s = '<li><a href="javascript:;"> <i class="iconfont left-nav-li" lay-tips=' +
			//					value.title + '>&#xe6b8;</i> <cite>' +
			//					value.title + '</cite> <i class="iconfont nav_right">&#xe697;</i></a>';
			//				for(var i = 0; i < value.children.length; i++) {
			//					var cr = value.children[i];
			//					s += '<li><a onclick="xadmin.add_tab(\'' + cr.title + '\',\'' + cr.url + '\')"><i class="iconfont">&#xe6a7;</i> <cite>' + cr.title + '</cite></a></li>';
			//				}
			//				s += "</li></li>" //有问题
			//				$("navs").append($(s));
			//
			//			});	

			/*getAllModuse = function() {
			        $.post(globalData.server + "dynamicMeun/dynamicMeunRun", {
			          'id': globalData.getUid(),
			          'token': globalData.getToken()
			        }, function(data1) {
			          $("#nav").html("");
			          $.each(data1, function(n, value) {
			            console.log(value);
			            var s = '<li><a href="javascript:;"><i class="iconfont left-nav-li" lay-tips=' + value.name + '>&#xe6b8;</i><cite>' + value.name + '</cite><i class="iconfont nav_right">&#xe697;</i></a><ul class="sub-menu">';
			            for(var i = 0; i < value.children.length; i++) {
			              var cr = value.children[i];
			              console.log(cr);
			              s += '<li><a onclick="xadmin.add_tab(\'' + cr.name + '\',\'' + cr.permission + '\')"><i class="iconfont">&#xe6a7;</i><cite>' + cr.name + '</cite></a></li>';

			            }
			            s += "</li></li>";
			            $("#nav").append($(s));
			          });
			        }, "json");

			      }*/
			getAllModuse = function() {
				$.post(globalData.server + "dynamicMeun/dynamicMeunRun", {
					'id': globalData.getUid(),
					'token': globalData.getToken()
				}, function(data1) {
					$("#nav").html("");
					$.each(data1, function(n, value) {
						console.log(value);
						var s = '<li><a href="javascript:;"><i class="iconfont left-nav-li" lay-tips=' + value.name + '>&#xe6b8;</i><cite>' + value.name + '</cite><i class="iconfont nav_right">&#xe697;</i></a><ul class="sub-menu">';
						if(value.children != null) {
							for(var i = 0; i < value.children.length; i++) {
								var cr = value.children[i];
								s += '<li><a onclick="xadmin.add_tab(\'' + cr.name + '\',\'' + cr.permission + '\')"><i class="iconfont">&#xe6a7;</i><cite>' + cr.name + '</cite></a></li>';
							}
						}

						s += "</ll></li>";
						$("#nav").append($(s));
					});
				}, "json");
			}
			getAllModuse();

			$('#msg').on("click", function(e) {
				//边缘弹出
				layer.open({
					type: 2,
					offset: 'rt' //具体配置参考：offset参数项
						//,content: '<div style="padding: 20px 80px;">内容</div>'
						,
					content: 'message.html',
					area: ['600px', '700px'],
					btn: '关闭',
					btnAlign: 'c' //按钮居中
						,
					shade: 0 //不显示遮罩
						,
					yes: function() {
						layer.closeAll();
					}
				});
			});
		</script>
	</body>

</html>